Socket
Socket
Sign inDemoInstall

mathjax

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mathjax

Beautiful and accessible math in all browsers. MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all browsers.


Version published
Weekly downloads
136K
decreased by-11.88%
Maintainers
1
Weekly downloads
 
Created

What is mathjax?

MathJax is a JavaScript display engine for mathematics that works in all browsers. It uses modern web technologies to typeset mathematical content in web pages, making it accessible and visually appealing.

What are mathjax's main functionalities?

Typesetting TeX and LaTeX

This feature allows you to convert TeX and LaTeX mathematical notation into SVG format for display in web pages.

const MathJax = require('mathjax');

MathJax.init({
  loader: {load: ['input/tex', 'output/svg']}
}).then((MathJax) => {
  const tex = 'E = mc^2';
  const svg = MathJax.tex2svg(tex);
  console.log(MathJax.startup.adaptor.outerHTML(svg));
}).catch((err) => console.log(err));

Typesetting MathML

This feature allows you to convert MathML (Mathematical Markup Language) into SVG format for display in web pages.

const MathJax = require('mathjax');

MathJax.init({
  loader: {load: ['input/mathml', 'output/svg']}
}).then((MathJax) => {
  const mathml = '<math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mi>E</mi><mn>2</mn></msup></math>';
  const svg = MathJax.mathml2svg(mathml);
  console.log(MathJax.startup.adaptor.outerHTML(svg));
}).catch((err) => console.log(err));

Typesetting AsciiMath

This feature allows you to convert AsciiMath notation into SVG format for display in web pages.

const MathJax = require('mathjax');

MathJax.init({
  loader: {load: ['input/asciimath', 'output/svg']}
}).then((MathJax) => {
  const asciimath = 'sum_(i=1)^n i^3=((n(n+1))/2)^2';
  const svg = MathJax.asciimath2svg(asciimath);
  console.log(MathJax.startup.adaptor.outerHTML(svg));
}).catch((err) => console.log(err));

Other packages similar to mathjax

Keywords

FAQs

Package last updated on 25 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc